const ControlEvent = {
  /**
   * 开始游戏
   */
  START_GAME:'control_event_start_game',
  /**
   * 结束游戏
   */
  END_GAME:'control_event_end_game',
  
  /**
   * 重新开始游戏
   */
  RESTART_GAME:'control_event_restart_game',
  /**
   * 显示编辑器
   */
  SHOW_EDITOR:'control_event_show_editor',
  
}
const ViewEvent={
  /**
   * 刷新树
   */
  FLUSH_TREE:'flush_tree',
  /**
   * 刷新编辑器
   */
  FLUSH_EDITER:'flush_editer',
  /**
   * 添加图片
   */
  ADD_IMAGE:'add_image',
  /**
   * 添加动画
   */
  ADD_ANIMATION:'add_animation',
  /**
   * 删除动画
   */
  DELETE_ANIMATION:'delete_animation',
  /**
   * 删除图片
   */
  DELETE_IMAGE:'delete_image',
  /**
   * 保存游戏
   */
  SAVE_GAME:'save_game'
}
enum DisplayObjectType{
  IMAGE='image',
  ANIMATION='animation'
}
// 后端java|php
const backEnd='java'
/**
 * 获取图片验证码地址
 * @returns 
 */
const getImageVerificationCodeUrl=()=>{
  const rand=Math.round(Math.random()*1000)
  if(backEnd==='java'){
    return process.env.VUE_APP_BASE_API+'getVerify?'+rand
  }else if(backEnd==='php'){
    return process.env.VUE_APP_BASE_API+'code.php?'+rand
  }
  return ''
}
interface ImageMapper{
  id:number
  path:string
  remove:number
  created:string
}
export {
    ControlEvent,
    ViewEvent,
    DisplayObjectType,
    getImageVerificationCodeUrl,
    ImageMapper
}